Next | Prev | Up | Top | Contents | Index

Determining Section Sizes with size

The size tool prints information about the sections (such as text, rdata, and sbss) of the specified object or archive files. The elf(4) reference page describes the format of these sections.


size Syntax

The syntax for size is:

size options [filename1 filename2...filenamen]

options

Specifies the format of the listing (see Table 2-10).

filename

Specifies the object or archive files whose properties are to be listed. If you do not specify a filename, the default is a.out.

size Options

Table 2-10 lists size options. For more information, see the size(1) reference page.

size Options
OptionAction
-APrints data section headers in System V format (default).
-BPrints output in BSD-style format.
-dPrints sizes in decimal (default).
-fPrints data on allocatable sections including the size, permission flags, and the total of the loadable sizes.
-FPrints data on loadable segments including the name and the total of the section sizes.
-nPrints nonloadable and nonallocatable section sizes.
-oPrints sizes in octal.
-svr4Prints output in SVR4-style format.
-VPrints the version of size that you are using.
-xPrints sizes in hexadecimal.


size Example

An example of the size command and the listings produced follows.

size a.out

 Section         Size           Physical              Virtual
                                 Address              Address
       .interp     21          268435856            268435856 
 .MIPS.options    104          268435880            268435880 
      .dynamic    464          268435984            268435984 
      .liblist     20          268436448            268436448 
  .MIPS.symlib     30          268436468            268436468 
         .msym    240          268436500            268436500 
       .dynstr    312          268436744            268436744 
       .dynsym    720          268437056            268437056 
         .hash    256          268437776            268437776 
   .MIPS.stubs     56          268438032            268438032 
         .text    460          268438088            268438088 
         .init     24          268438548            268438548 
         .data     17          268505088            268505088 
        .sdata      8          268505108            268505108 
          .got    112          268505120            268505120 
          .bss     36          268505232            268505232 

Next | Prev | Up | Top | Contents | Index